package day08Test;

import java.util.Random;

public class Test1 {
    public static void main(String[] args) {
        Random r = new Random();

        int[] arr = {2,588,888,1000,10000};
        int[] newArr = new int[arr.length];

        for (int i = 0; i < arr.length;) {
            int randomIndex = r.nextInt(arr.length);
            int price = arr[randomIndex];
            boolean flag = contains(newArr,price);
            if (!flag){
                newArr[i] = price;
                i++;
            }

        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(newArr[i]);
        }
    }
    public static boolean contains(int[] arr , int price) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == price) {
                return true;
            }
        }
        return false;
    }
}

